package cn.agiledata.bank.myspace.bean;

import java.util.Date;

import cn.agiledata.bank.common.util.StringUtil;
import cn.agiledata.bank.common.util.WeatherUtil;
import cn.agiledata.bank.hibernateBean.AcctBalHis;
import cn.agiledata.bank.hibernateBean.SubAccount;
import cn.agiledata.bank.hibernateBean.Transaction;


public class AcctBalHisBean {
	AcctBalHis a =null;
	SubAccount s =null;	
	SubAccount sa = null;
    Transaction t = null;
	
	public AcctBalHisBean (){}
	public AcctBalHisBean (AcctBalHis a,SubAccount s,SubAccount sa,Transaction t){
		this.a=a;
		this.s=s;
		this.sa = sa;
		this.t = t;
	
	}
	String accountId;
	String subAccountId;
	String balance;
	String lockAmount;
	String fee;
	String accountName;//对方账户名称
	String otherSubAccountId;//对方子账户id
    String thisAccountName;
    String amount;
	String transId;
	Date upDate;
	String beginDate;
	String endDate;
	String startPage;
	String tid;
	String ttransId;
	String actionType;
	String accountType;
	private String payMode;//收/付标志
	
	
	public String getAccountType() {
		return sa.getAccount().getAccountType();
	}
	public void setAccountType(String accountType) {
		this.accountType = accountType;
	}
	public String getActionType() {
		return t.getActionType().getActionName().toString();
	}
	public void setActionType(String actionType) {
		this.actionType = actionType;
	}
	public String getTtransId() {
		return t.getTransId();
	}
	public void setTtransId(String ttransId) {
		this.ttransId = ttransId;
	}
	public String getTid() {
		return t.getId()+"";
	}
	public void setTid(String tid) {
		this.tid = tid;
	}
	public Transaction getT() {
		return t;
	}
	public void setT(Transaction t) {
		this.t = t;
	}
	public AcctBalHis getA() {
		return a;
	}
	public void setA(AcctBalHis a) {
		this.a = a;
	}
	public String getAccountId() {
		return s.getAccountId();
	}
	public void setAccountId(String accountId) {
		this.accountId = accountId;
	}
	public String getAccountName() {
//		if(t.getActionType().getId().toString().equals(Constant.ACTION_TYPE_A)) { //充值
//			BankTemplate bt = (BankTemplate)IPBAppFactory.getObj("bankTemplate");
//			return ((BankInfo)bt.getBankInfo(t.getBankSeq().toString())).getBankName();
//		} else if(t.getActionType().getId().toString().equals(Constant.ACTION_TYPE_B)) { //线下充值
//			BankTemplate bt = (BankTemplate)IPBAppFactory.getObj("bankTemplate");
//			if(t.getBankSeq().longValue() != 0) { //银行汇款
//				return ((BankInfo)bt.getBankInfo(t.getBankSeq().toString())).getBankName();	
//			} else { //邮局汇款
//				return "邮局";
//			}
//		}else if(t.getActionType().getId().toString().equals(Constant.ACTION_TYPE_C)) { //账户间交易显示对方email
//			return sa.getAccount().getName();
//		} else if(t.getActionType().getId().toString().equals(Constant.ACTION_TYPE_D)) { //提现
//			return s.getAccount().getName();
//		} else if(t.getActionType().getId().toString().equals(Constant.ACTION_TYPE_F)) {  //银行付款给对方账户
//			return t.getPersonName();
//		} else if(t.getActionType().getId().toString().equals(Constant.ACTION_TYPE_G)) {  //账户付款给对方银行
//			return t.getPersonName();
//		} else if(t.getActionType().getId().toString().equals(Constant.ACTION_TYPE_H)) {  //内部账户转账
//			return s.getAccount().getName();
//		} else {
//			return "";
//		}
		if(t.getCredit().getAccount().getId().equals(s.getAccount().getId())) return WeatherUtil.getNameOrEmailOrMobileByAccount(t.getDebit().getAccount());
		else return WeatherUtil.getNameOrEmailOrMobileByAccount(t.getCredit().getAccount());		
	}
	
	public String getPayMode() {
		if(!StringUtil.isStrEmpty(a.getFlag())) {
			if(a.getFlag().equals("1")) {
				return "收";
			} else if(a.getFlag().equals("-1")) {
				return "付";
			} else {
				return "";
			}
		} else {
			return "";
		}
	}
	public void setPayMode(String payMode) {
		this.payMode = payMode;
	}
	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}
	public String getBalance() {
		return a.getBalance()+"";
	}
	public void setBalance(String balance) {
		this.balance = balance;
	}
	public String getFee() {
		return a.getFee()+"";
	}
	public void setFee(String fee) {
		this.fee = fee;
	}
	public String getLockAmount() {
		return a.getLockAmount()+"";
	}
	public void setLockAmount(String lockAmount) {
		this.lockAmount = lockAmount;
	}
	public SubAccount getS() {
		return s;
	}
	public void setS(SubAccount s) {
		this.s = s;
	}
	public SubAccount getSa() {
		return sa;
	}
	public void setSa(SubAccount sa) {
		this.sa = sa;
	}
	public String getSubAccountId() {
		return a.getId()+"";
	}
	public void setSubAccountId(String subAccountId) {
		this.subAccountId = subAccountId;
	}
	public String getTransId() {
		return a.getTransid()+"";
	}
	public void setTransId(String transId) {
		this.transId = transId;
	}
	public Date getUpDate() {
		return a.getUpdateTime();
	}
	public void setUpDate(Date upDate) {
		this.upDate = upDate;
	}
	public String getAmount() {
		return a.getAmount()+"";
	}
	public void setAmount(String amount) {
		this.amount = amount;
	}
	public String getThisAccountName() {
		return s.getAccountName();
	}
	public void setThisAccountName(String thisAccountName) {
		this.thisAccountName = thisAccountName;
	}
	public String getOtherSubAccountId() {
		return sa.getAccount().getId()+"";
	}
	public void setOtherSubAccountId(String otherSubAccountId) {
		this.otherSubAccountId = otherSubAccountId;
	}
	
	}
	
	
	

